/*
 *  Copyright 2010 mazhao.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package shopping.commons;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * @author mazhao
 */
public class BaseAction extends ActionSupport {
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // CRUD Defination Section
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    public static final String TYPE_CREATE = "create";
    public static final String TYPE_UPDATE = "update";
    public static final String TYPE_DELETE = "delete";
    protected static final Map<String, String> OPERATION_TYPES = new HashMap<String, String>();

    static {
        OPERATION_TYPES.put(TYPE_CREATE, TYPE_CREATE);
        OPERATION_TYPES.put(TYPE_UPDATE, TYPE_UPDATE);
        OPERATION_TYPES.put(TYPE_DELETE, TYPE_DELETE);
    }

    public Map<String, String> getOperationTypes() {
        return OPERATION_TYPES;
    }

    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // Logging Section
    //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    protected Log log = LogFactory.getLog(this.getClass());

}
